<div id="body_container">
    <div class="detail_container">
      <div class="detail_box">
        <div class="detail_top_curve">
          <div class="detail_detail_content">
            <div class="welcomezone">
              <div style="margin-bottom:10px;">
                <div class="blueboldheading">
                  <h1>Results</h1>
                </div>
				
<% @list = Array.new %>

<% if params[:search][:maxchildren] == ''  && params[:search][:minheight] == '' && params[:search][:maxheight] =='' && params[:search][:religion] == "Indifferent" && params[:search][:morphology] == "Indifferent" %>
<% @list = Information.all %>

<% else %>

	<% if params[:search][:maxchildren] != '' %>
		<% @list = @list|(Information.where(:children => params[:search][:minchildren]..params[:search][:maxchildren] ))%>
	<% end %>

	
	<% if params[:search][:minheight] != ''  && params[:search][:maxheight] != '' %>
		<% @list = @list|(Information.where( :height => params[:search][:minheight]..params[:search][:maxheight])) %>
	<% end %>

	<% if params[:search][:religion] != "Indifferent" %>
		<% @list = @list|(Information.where(:religion => params[:search][:religion])) %>
	<% end %>

	<% if params[:search][:morphology] != "Indifferent" %>
		<% @list = @list|(Information.where(:morphology => params[:search][:morphology])) %>
	<% end %>
	
	
<%end%> 

<% if params[:search][:astrological] == '1' %>
	
	<% if Information.find(session[:user_id]).sign == 'Aries' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Pisces' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Virgo' } %>
	<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Taurus' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Gemini' || Information.find(x.id).sign == 'Sagittarius' || Information.find(x.id).sign == 'Libra' } %>
	<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Gemini' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Pisces' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Virgo' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Cancer' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Gemini' || Information.find(x.id).sign == 'Aquarius' || Information.find(x.id).sign == 'Capricorn' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Leo' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Taurus' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Aquarius' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Virgo' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Libra' || Information.find(x.id).sign == 'Aquarius' || Information.find(x.id).sign == 'Sagittarius' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Libra' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Pisces' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Virgo' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Scorpio' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Aries' || Information.find(x.id).sign == 'Leo' || Information.find(x.id).sign == 'Sagittarius' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Sagittarius' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Cancer' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Virgo' } %>
		<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Capricorn' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Aries' || Information.find(x.id).sign == 'Leo' || Information.find(x.id).sign == 'Virgo' } %>
	<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Aquarius' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Taurus' || Information.find(x.id).sign == 'Cancer' || Information.find(x.id).sign == 'Virgo' } %>
	<%end %>
	
	<% if Information.find(session[:user_id]).sign == 'Pisces' %>
		<% @list.delete_if {|x| Information.find(x.id).sign == 'Aries' || Information.find(x.id).sign == 'Capricorn' || Information.find(x.id).sign == 'Gemini' } %>
	<%end %>
	
<% end %>

<% if params[:search][:city] == '1' %>
	<% @list.delete_if {|x| User.find(x.id).adress != User.find(session[:user_id]).adress} %>
<% end %>


<% @list = @list.sort_by {rand} %>
<% @list.each do |p| %>
	<% if User.find(p.id).sex == User.find(session[:user_id]).interest || p.id != session[:user_id] && User.find(session[:user_id]).interest == 'Both' %>
		<div> <br />
            <h2><%= User.find(p.id).username%> </h2>
			<% match = Information.find(p.id) %>
			<% if User.find(p.id).photo.file? %>
                  <%= image_tag User.find(p.id).photo(:small), :hspace=>15, :vspace=>15, :class=>"project-img" %>
			<% else %>
				<%= image_tag "d.png", :width => 150, :height => 150, :hspace=>15, :vspace=>15, :class=>"project-img" %>
			<% end %>
                  <p>looking for a(n) <%= match.typeofrelation %> relationship.<br />
                    <%= (match.height.to_f/100.to_f) %> meters, <%= match.morphology %>, <%= match.hair %> hair and <%= match.eyes %> eyes.<br />
                  </p>
                  </br>
			<span class="know_more"><%= link_to 'Know more',"/profile/"+ p.id.to_s() %></span>
			</br>
			<span class="know_more">
			<%= link_to 'Write to '+ User.find(p.id).username,"/private_message/new?param1="+User.find(p.id).username %></span>
		</br>
		</br>
		</br>
		</br>
		</br>
		</br>
           </div>
		
		 </br>
		</br>
		</br>
		
	<% end %>
	</br>
<%end%>

</br>
</br>

No more results found with these specifications.

